import type { SparkTypes } from '#/utils/types/types';
/**
 * 定义 RowType 接口，用于描述 ${functionName} 数据库行的结构。
 */
export interface RowType {
  id: string;
<#if model?? && model == "tree">
  pid: string;
  isLeaf: object;
  children: any;
</#if>
<#list fields as field>
  <#if field.fieldPackagePath?contains("String")>
  ${field.fieldName}: string;
  <#elseif field.fieldPackagePath?contains("Integer")>
  ${field.fieldName}: number;
  <#else >
  ${field.fieldName}: any;
  </#if>
</#list>
  createBy: string;
  createTime: string;
  updateBy: string;
  updateTime: string;
}

/**
 * 详情字段配置
 */
export const DetailsColumns: SparkTypes.DetailsTypes[] = [
<#list fields as field>
  {
    title: '${field.fieldAnnotation}',
    <#if field.fieldRelevance == 1>
      <#if field.fieldRelevanceMode != 1>
    field: '${field.fieldName}_dictText',
      <#else >
    field: '${field.fieldName}',
      </#if>
    <#else >
    field: '${field.fieldName}',
    </#if>
    <#if field.componentName??>
      <#if field.componentName == "Textarea" || field.componentName == "SparkUploadImg" || field.componentName == "SparkUploadFile" || field.componentName == "SparkEditor">
    span: 3,
        <#if field.componentName == "SparkUploadImg" || field.componentName == "SparkUploadFile">
    params: {
          <#if field.componentName == "SparkUploadImg">
      image: true,
          <#else >
      files: true,
          </#if>
    },
        </#if>
        <#if field.componentName == "SparkEditor">
    params: {
      html: true,
    },
        </#if>
      </#if>
      <#if field.fieldRelevance == 1>
        <#if field.fieldRelevanceMode == 1>
    params: {
      dictCode: '${field.fieldRelevanceModeValKey}',
    },
        </#if>
      </#if>
    </#if>
  },
</#list>
];
